package mercado.aberto;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Jaguar
 */
import java.sql.*;

public class DAO {

    ResultSet rs;
    Connection con;
    PreparedStatement pstmt;

    public boolean Conectar() throws Exception {
        Class.forName("org.postgresql.Driver");
        String url = "jdbc:postgresql://localhost:5432/postgres";
        String user = "postgres";
        String senha = "postgres";
        con = DriverManager.getConnection(url, user, senha);
        return true;
    }

    public void Desconectar() throws Exception {
        if (con != null){
            con.close();
        }

    }
}